﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>添加</title>
    <link href="../Scripts/sui/css/sui.min.css" rel="stylesheet" />
</head>
<body ms-controller="commview">
    <form id="sui-form1" class="sui-form form-horizontal" style="padding-top:20px;" >
        <div ms-include-src="../ADD/{{FunCode}}.html?rem={{rem}}" data-include-rendered='render' style="padding-bottom:20px;">

        </div>

        <div class="sui-navbar navbar-fixed-bottom" style="background-color: #F8F8F8;">
            <div class="sui-btn-group" style="width:98%; text-align:center;padding-bottom:5px;">
                <a class="sui-btn btn-xlarge btn-primary" ms-click="SaveData(this)" >保存</a>
                <a class="sui-btn btn-xlarge" ms-click="cancel()" style="margin-left:5px;">取消</a>

            </div>

        </div>
    </form>

    <script src="../Scripts/jquery.min.js"></script>
    <script src="../Scripts/sui/js/sui.min.js"></script>
  <script src="../Scripts/layer/layer.js"></script>
  <script src="../Scripts/avalon.js"></script>
  <script src="../Scripts/ComFunJS.js?ver=201611280"></script>
  <script type="text/javascript">
      var model = avalon.define({
          $id: "commview",
          // nowuser: ComFunJS.getNowUser(),//当前用户
          FunCode: ComFunJS.getQueryString("FunCode"),//模块代码
          ID: ComFunJS.getQueryString("ID"),//数据ID
          FormType: ComFunJS.getQueryString("FormType", "add"),
          rem:Math.random(),
          render: function () {
              if (tempmodel) {
                  tempmodel.inittemp(model.ID);
                  if (parent.layer) {
                      var index = parent.layer.getFrameIndex(window.name)
                      parent.layer.title(tempmodel.name, index)
                  }
              }
          },
          SaveData: function (dom, status) {
              $("#sui-form1").validate();
              //$("#sui-form1").submit();

              if ($("#sui-form1 div.msg-error:visible").length == 0) {
                  if (tempmodel) {
                      tempmodel.SaveData();
                  }
              }

          },
          cancel: function () {
              parent.layer.closeAll();
          }


      })

      avalon.ready(function () {
          //ComFunJS.initsetajax();


      })
  </script>

   
</body>
</html>
